import {myRequest} from '../network/http.js'

 const baseUrl = 'customer/addressBook'
 
 
export function addAddress (config) {  
	return myRequest({
		url:baseUrl,
		method:'post',
		data:config
	})
}
 
export function updateAddress (config) {  
	return myRequest({
		url:baseUrl,
		method:'put',
		data:config
	})
}

export function delAddress (config) {  
	return myRequest({
		url:baseUrl+'/?id=' + config,
		method:'delete'
	})
}

export function queryDefaultAddress () {  
	return myRequest({
		url:baseUrl+'/default',
		method:'get'
	})
}

export function setDefaultAddress (config) {  
	return myRequest({
		url:baseUrl+'/default',
		method:'put',
		data:config
	})
}

export function addressList (config) {  
	return myRequest({
		url:baseUrl+'/list',
		method:'get',
		data:config
	})
}

export function queryAdressById (config) {  
	return myRequest({
		url:baseUrl+'/'+config,
		method:'get'
	})
}